﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SSRSReporting.Web.Helpers;
using Microsoft.Reporting.WebForms;

namespace SSRSReporting.Web
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rvReport.Reset();
                rvReport.ServerReport.ReportServerCredentials = new ReportCredentials();
                rvReport.ServerReport.ReportServerUrl = new Uri(ReportConfigurations.reportServerPath);
                rvReport.ServerReport.ReportPath = ReportConfigurations.targetReportFolder + "<Report RDL name without *.rdl extension>";
                rvReport.ProcessingMode = ProcessingMode.Remote;                
                ReportParameter[] rpArray = new ReportParameter[] { };
                rvReport.ServerReport.SetParameters(rpArray);
                rvReport.ServerReport.Refresh();
            }
        }
    }
}